import { ChangeDetectionStrategy, Component } from '@angular/core';
import { TreeNode } from '@iux/live';

@Component({
  selector: 'app-icons',
  templateUrl: './icons.component.html',
  styles: [
    `
      .ui-tree-select-container {
        width: 368px;
      }
    `,
  ],
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class IconsComponent {
  treeData: TreeNode[] = [
    {
      label: 'Documents',
      contentToggleIcon: {
        // 自定义内容展开折叠图标
        true: 'icon-data-center',
        false: 'icon-storage',
      },
      children: [
        {
          label: 'Expenses.xls',
          contentToggleIcon: 'icon-storage', // 自定义内容图标
          isLeaf: true,
        },
        {
          label: 'Resume.doc',
          contentToggleIcon: 'icon-storage', // 自定义内容图标
          isLeaf: true,
        },
      ],
    },
    {
      label: 'Word', // 默认内容图标
      children: [
        {
          label: 'Expenses.doc', // 默认内容图标
          isLeaf: true,
        },
        {
          label: 'Resume.doc',
          contentToggleIcon: '', // 不显示内容icon
          isLeaf: true,
        },
      ],
    },
    {
      label: 'Pictures',
      contentToggleIcon: '', // 不显示内容icon
      children: [
        {
          label: 'logo.png',
          contentToggleIcon: 'icon-storage', // 自定义内容图标
          isLeaf: true,
        },
        {
          label: 'banner.pnd', // 默认内容图标
          isLeaf: true,
        },
      ],
    },
  ];
  selection: TreeNode[];

  constructor() {}
}
